package de.fuberlin.inf.dbs.ue07;

import de.fuberlin.inf.utils.JSONable;

public class City implements JSONable {
	private String name;
	private Province province;
	private int population;
	
	public City(String name, String province, int population) {
		this.name = name;
		this.province = Province.getInstance(province);
		this.population = population;
	}

	@Override
	public String toJSON() {
		StringBuffer sb = new StringBuffer();
		sb.append("{'name':'");
		sb.append(this.name);
		sb.append("','province':'");
		sb.append(this.province.getName());
		sb.append("','population':");
		sb.append(this.population);
		sb.append("}");
		return sb.toString();
	}
}
